﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Content/Default.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SCSService.Post>>" %>
<%@ Import Namespace="SCS.Core" %>
<%@ Import Namespace="SCS.Core.Models" %>
<%@ Import Namespace="SCS.Core.Models.ModelsFontend" %>
<%@ Import Namespace="SCSService" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ListPost
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div>      
        <% Html.RenderPartial("~/Views/Commont/UserInfomation.ascx"); %>
    </div>
    <div id="categoryPost" >
        <%=ViewData["ListCategory"]%>
    </div>	
    <div id="listPost">
        
        <div id="grid">
        
		<% if (Model.Count() == 0) { %>
			<div id="emptyMessage">
				Không bài viết nào 
			</div>
		<% } else { %>
				    			
			<div id="data">
				<% foreach (var item in Model)
                   { %>
               
                 <div class="data">
  	                <table style="border:1px">
	                    <tr>
                            <td>
                              <a href="#"><img src='<%=item.PostImage %>' alt="" border="1px" class="Img"/></a>
                            </td>
                            <td valign="top">
                              <span class="text">
                                <%=Html.ActionLink(item.PostTitle, "PosttDetail", new { id = item.PostID})%>
                              </span>
                              <br />
                              <div style="float:left; margin-top:5px;">
                                <table>
                                    <tr>
                                        <td colspan="2">
                                             <span>
                                               <%=Html.Encode(item.PostAbstract) %>
                                            </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                           <%=item.PostCreat %>
                                        </td>
                                        <td>
                                                                                 
                                         <%=Html.ActionLink("more", "PostDetail", new { id = item.PostID })%>
                                                                                  
                                        </td>
                                     </tr>
                                </table>
                              </div>
                            </td>
                        </tr>
	                </table>
		         </div>
                <% } %>
			</div> <!-- data -->
           
			    <% Html.RenderPartial("~/Views/Commont/Paging.ascx"); %>
		  
		<% } %>
	</div>  <!-- grid -->	
 	</div>    	

</asp:Content>
